home *** CD-ROM | disk | FTP | other *** search
- #include "pms_main.h"
- #include "Email.h"
-
-
- /*
- SampleEmail:
- Prints out a dummy email (same output as a Eudora print)
- Parms: formP Parent form.
- Return: 0 Success.
- -1 Error.
- */
-
- void
- SampleEmail (FormPtr formP)
- {
- UInt err;
- UInt refNum = 0;
-
-
- // Load the library
- err = SampleLoad(formP, PageManager);
-
-
- // Make sure refNum is not 0 (we should not be here if it is).
- refNum = MainFormGetRefNum (formP);
- ErrFatalDisplayIf ((refNum == 0), "Invalid state!");
-
-
- // Open the printer
- err = SampleOpen(formP, PageManager);
- ErrFatalDisplayIf ((err != 0), "Could not open printer");
-
- // Set the settings
- SampleSettings(formP, PageManager);
-
- // Print the text
- SamplePrintEmail( formP);
-
- // Close printer
- SampleClose(formP, PageManager);
-
- // Unload the library
- SampleUnload(formP);
-
-
- }
-
-
- /*
- SamplePrintEmail:
- Prints the text
- Parms: formP Parent form.
- Returns: 0 Success.
- -1 Error.
- */
-
-
-
- void
- SamplePrintEmail (FormPtr formP)
- {
-
- UInt refNum;
- PagFontType font;
-
-
- refNum = MainFormGetRefNum (formP);
- ErrFatalDisplayIf ((refNum == 0), "Invalid state!");
-
- // Set font to Times Roman 14 bold.
- StrCopy (font.typeface, "Times Roman");
- font.height = 12;
- font.bold = true;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- // Begin printing text.
-
- PagPrintText(refNum, "From: ");
-
- StrCopy (font.typeface, "Courier");
- font.height = 12;
- font.bold = false;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintText(refNum, "Jim Burrow <Jim@burrow.net>");
- PagNewLine(refNum);
-
- StrCopy (font.typeface, "Times Roman");
- font.height = 12;
- font.bold = true;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintText(refNum, "To: ");
-
- StrCopy (font.typeface, "Courier");
- font.height = 12;
- font.bold = false;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintText(refNum, "\"John@davis.net\" <john@davis.net>");
- PagNewLine(refNum);
-
- StrCopy (font.typeface, "Times Roman");
- font.height = 12;
- font.bold = true;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintText(refNum, "Date: ");
-
- StrCopy (font.typeface, "Courier");
- font.height = 12;
- font.bold = false;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintText(refNum, "Monday, August 30, 1999 3:32 PM");
- PagNewLine(refNum);
-
- StrCopy (font.typeface, "Times Roman");
- font.height = 12;
- font.bold = true;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintText(refNum, "Subject: ");
-
- StrCopy (font.typeface, "Courier");
- font.height = 12;
- font.bold = false;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintText(refNum, "re: How do I print from Palm OS?");
-
- PagNewLine(refNum);
- PagNewLine(refNum);
- PagNewLine(refNum);
-
- // Begin printing body
-
- PagPrintLine(refNum, "John,");
- PagNewLine(refNum);
- PagPrintLine(refNum, ">From your previous email it seems that you're in need of Bachmann Print");
- PagPrintLine(refNum, "Manager. Check out http://www.bachmannsoftware.com. Here is a blurb from");
- PagPrintLine(refNum, "their page:");
- PagNewLine(refNum);
-
- StrCopy (font.typeface, "Times Roman");
- font.height = 12;
- font.bold = true;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintLine(refNum, "Why Print from the Palm Computing Platform?");
- PagNewLine(refNum);
-
- StrCopy (font.typeface, "Courier");
- font.height = 12;
- font.bold = false;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintLine(refNum, "The Palm Connected Organizer is a great device for helping mobile workers");
- PagPrintLine(refNum, "and other users on the go gain access to critical information when and");
- PagPrintLine(refNum, "where they need it. But handheld devices have a limited display area, and");
- PagPrintLine(refNum, "even handheld applications require the ability to quickly and easily print");
- PagPrintLine(refNum, "information in a rich graphical format. Receipts, forms, reports, e-mails,");
- PagPrintLine(refNum, "directions, maps, and spreadsheets all need to be printed from time to time");
- PagPrintLine(refNum, "in order to give information to another person, produce a record of a");
- PagPrintLine(refNum, "transaction, or to ciew information in a larger, more easily readable format.");
-
- StrCopy (font.typeface, "Times Roman");
- font.height = 12;
- font.bold = true;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagNewLine(refNum);
- PagPrintLine(refNum, "What is Bachmann Print Manager?");
- PagNewLine(refNum);
-
- StrCopy (font.typeface, "Courier");
- font.height = 12;
- font.bold = false;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintLine(refNum, "Bachmann Print Manager gives Palm Computing Platform application developers");
- PagPrintLine(refNum, "the power to create stunning printed output directly from their Palm Pilot");
- PagPrintLine(refNum, "application. Now, with Bachmann Print Manager, you can print any");
- PagPrintLine(refNum, "information from your Palm Connected Organizer, using either a serial or");
- PagPrintLine(refNum, "infrared connection to popular portable, standalone, or networked printers.");
- PagPrintLine(refNum, "There is no longer any need to synchronize data back to the desktop in");
- PagPrintLine(refNum, "order to create printed output that is of the caliber youw ould expect from");
- PagPrintLine(refNum, "a Windows application.");
- PagNewLine(refNum);
- PagPrintLine(refNum, "Bachmann Print Manager is a standard Palm OS Shared Library, so it is");
- PagPrintLine(refNum, "easily and tightly integrated with any Palm Pilot application. Both");
- PagPrintLine(refNum, "Metrowerks CodeWarrior and GCC environments are supported for development.");
- PagNewLine(refNum);
- PagNewLine(refNum);
-
- StrCopy (font.typeface, "Times Roman");
- font.height = 12;
- font.bold = true;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintLine(refNum, "What HandHeld/Mobile Applications need Bachmann Print Manager?");
-
- StrCopy (font.typeface, "Courier");
- font.height = 12;
- font.bold = false;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagNewLine(refNum);
- PagPrintLine(refNum, "Personal Information Management");
- PagPrintLine(refNum, "E-mail and other internet applications");
- PagPrintLine(refNum, "Mapping/GPS software");
- PagPrintLine(refNum, "Sales Force Automation");
- PagPrintLine(refNum, "Reporting");
- PagPrintLine(refNum, "Manufacturing");
- PagPrintLine(refNum, "Retail Sales");
- PagPrintLine(refNum, "Your Application");
-
- PagNewLine(refNum);
-
- StrCopy (font.typeface, "Times Roman");
- font.height = 12;
- font.bold = true;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagPrintLine(refNum, "Bachmann Print Manager Features");
-
- StrCopy (font.typeface, "Courier");
- font.height = 12;
- font.bold = false;
- font.italics = false;
- PagSetFont (refNum, &font);
-
- PagNewLine(refNum);
-
- PagPrintLine(refNum, "WYSIWYG print engine for Palm OS");
- PagPrintLine(refNum, "Draw rectangles, lines, proportional fonts, bitmaps and more!");
- PagPrintLine(refNum, "Infrared and serial printing capability for custom and commercial");
- PagPrintLine(refNum, "application developers.");
- PagPrintLine(refNum, "English-like C/C++ application programming interface");
- PagPrintLine(refNum, "Extremely small memory footprint");
- PagPrintLine(refNum, "Fast! Bachmann Print Manager is optimized for speed!");
- PagPrintLine(refNum, "Employs printer driver model familiar to Windows programmers");
- PagPrintLine(refNum, "Supports standard IrDA_enabled printers");
- PagPrintLine(refNum, "Transparently prints via infrared or serial connection by changing one");
- PagPrintLine(refNum, "simple setting");
- PagPrintLine(refNum, "Uses Shared Library interface already familiar to Palm developers.");
- PagPrintLine(refNum, "Bachmann Print Library comes with electronic documentation and sample code");
- PagPrintLine(refNum, "to enable the fastest possible integration of printing with your application!");
-
- PagNewLine(refNum);
-
- PagNewLine(refNum);
-
- PagPrintLine(refNum, "I hope this answered any questions you may have had.");
- PagNewLine(refNum);
- PagPrintLine(refNum, "Jim Burrow");
-
-
- }